#include "widget.h"
#include "ui_widget.h"
#include "mypushbutton.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    // QPushButton *button2 = new QPushButton("第二个按钮",this);
    // button2 -> move(200,200);

    this -> setWindowTitle("星泽：");

    //this -> setFixedSize(500,500);
    this -> resize(500,500);

    MyPushButton * button = new MyPushButton;
    button -> setParent(this);
    button -> setText("按钮一");
    //button -> move(200,100);
    button -> setFixedSize(200,25);

    //信号与槽
    QPushButton * quitBtn = new QPushButton("关闭窗口",this);
    connect(quitBtn,&QPushButton :: clicked,this,&QPushButton :: close);
    quitBtn ->move(425,475);

    //信号与槽
    QPushButton * button2 = new QPushButton;
    button2 -> setParent(this);
    button2 -> setText("关闭窗口");
    connect(button2,&QPushButton :: clicked,this,&QPushButton :: close);
    button2 -> move(100,100);
    button2 -> setFixedSize(300,300);

    QPushButton * button3 = new QPushButton("按钮三" , this);

}

Widget::~Widget()
{
    delete ui;
}
